package com.wuxiaofan.coupon.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.coupon.entity.SmsSpuBounds;
import com.wuxiaofan.coupon.entity.custom.SmsSpuBoundsCustom;
import com.wuxiaofan.coupon.mapper.SmsSpuBoundsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.coupon.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class SmsSpuBoundsService {
    @Autowired
    private SmsSpuBoundsMapper smsSpuBoundsMapper;
    @Resource
    private Idgenerator idgenerator;
    public SmsSpuBounds findById(String id){
        return smsSpuBoundsMapper.selectById(id);
    }

    public SmsSpuBoundsCustom findCountByMap(Map paraMap){
        return smsSpuBoundsMapper.findCountByMap(paraMap);
    }

    public SmsSpuBoundsCustom findGroupByMap(Map paraMap){
        return smsSpuBoundsMapper.findGroupByMap(paraMap);
    }

    public List<SmsSpuBoundsCustom> findByMap(Map paraMap){
        return smsSpuBoundsMapper.findByMap(paraMap);
    }

    public Page<SmsSpuBoundsCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(smsSpuBoundsMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        smsSpuBoundsMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        smsSpuBoundsMapper.deleteById(id);
    }

    public SmsSpuBounds save(SmsSpuBounds smsSpuBounds){
        smsSpuBounds.setId(idgenerator.getId());
        smsSpuBoundsMapper.insert(smsSpuBounds);
        return smsSpuBounds;
    }

}
